www.gusucode.com > VC++ 新手写的简单客房管理系统源码程序 > VC++ 新手写的简单客房管理系统源码程序/code/tot/LogDialog.cpp

    //Download by http://www.NewXing.com
// LogDialog.cpp : implementation file
//

#include "stdafx.h"
#include "tot.h"
#include "LogDialog.h"
#include "SysDialog.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CLogDialog dialog


CLogDialog::CLogDialog(CWnd* pParent /*=NULL*/)
	: CDialog(CLogDialog::IDD, pParent)
{
	//{{AFX_DATA_INIT(CLogDialog)
	m_accout = _T("");
	m_pass = _T("");
	//}}AFX_DATA_INIT
}


void CLogDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CLogDialog)
	DDX_Text(pDX, IDC_ACCOUT, m_accout);
	DDX_Text(pDX, IDC_PASS, m_pass);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CLogDialog, CDialog)
	//{{AFX_MSG_MAP(CLogDialog)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CLogDialog message handlers

void CLogDialog::OnOK() 
{
	// TODO: Add extra validation here

   UpdateData(true);
     int i=0;	

	UpdateData(true);
	if(m_accout=="jw"&&m_pass=="0903")
	{CDialog::OnOK();
      CSysDialog sdlg;
	  sdlg.DoModal();
	}
		else
		{i++;
		  AfxMessageBox("帐户名或密码错误\n请重新输入!");
		  GetDlgItem(IDC_ACCOUT)->SetFocus();
		  if(i==3)
		  {AfxMessageBox("输入错误次数太多!");CDialog::OnOK();}
	    }


}